home *** CD-ROM | disk | FTP | other *** search
- On Fri, 26 May 1978, Morten Bolstad wrote:
-
- >
- > Oki, here we go again withanother question.
- >
- >
- > Is it slowing the program down if i have alot of procedures
- > that the main procedures jumps to and return back to, like this:
- > (I have five of the Main procedures)
- >
- > Will this be slower than having all the code in Procedure A,B,C,D,E,F ang G
- > in gosubs inside the Main1 proceure????
- > But then again if i must have all the code in Procedure A-G inside Main 1
- > procedure then i must have all that code inside Main 2-5 also.
- >
- > What will be quickest and easiest?????
- >
- Use subroutines anywhere speed really matters - the exact same code
- takes longer in a procedure because of the time needed to set up the
- memory for a procedure - new variables etc. whereas a gosub is simply
- a switch in location. Use a mixture of both. Use procedures for things
- that aren't speed dependant - setup, load info, save info, highscore,
- help screen whatever (I don't know what sort of thing you're writing)
- and keep the subs for the in game loop or maths intensive bits or
- whatever. The subs may be messier than procs but when compiled who
- sees your code anyway?
-
- ### ### ######## ########### ###########
- #### #### ### ### ### ###
- ##!## ##!## #!# #!# #!# #!#
- !#! #!#!# !@! !@!!@@!!@! !@! !@! mattw@netsoc.ucd.ie
- !!! ! !!! !!! !!! !!! !!! x x
- :!: :!: :!: :!: :!: :!: \__/
- ::: ::: ::: ::: ::: :::
- :: :: :: :: : :
-
-
-